package com.cet.lxf.io.test01;

import java.io.File;
import java.io.IOException;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2021-11-05 17:16
 **/
public class FilePathTest {

    public static void main(String[] args) throws IOException {

        File f1 = new File("F:\\test\\a.txt");
        File f2 = new File("sub\\javac");
        System.out.println(f1);
        System.out.println(f1.getPath());
        System.out.println(f1.getAbsolutePath());
        System.out.println(f2.getCanonicalPath());
        System.out.println(File.separator);
        if (f2.createNewFile()) {
            System.out.println(f1.isDirectory());
            System.out.println(f1.isFile());
        }
    }
}
